import { cached } from '@/utils'
import { getEnumDict, ENUM_MAP } from './enumDict'

const tags = {
  0: 'info',
  1: 'success',
  9: 'danger'
}

export const auditState = {
  NOT_OUT_STORE: '0', // 待审核
  OUT_STORE: '1', // 同意
  REFUSE_OUT_STORE: '9' // 拒绝
}

export async function getStoreOutStatus() {
  const { data } = await getEnumDict(ENUM_MAP.storeOutStatus)
  return data
}

export const storeOutStatusTag = cached(function(val) {
  if (!val) return ''
  return tags[val]
})

